package cn.edu.scau.cmi.dengzhengyu.safe;

import java.util.HashSet;
import java.util.Set;

public class SafeTeam extends SafeComponent {
	
	private String name;
	
	private Set<SafeComponent> children = new HashSet<SafeComponent>();

	public SafeTeam(String name) {
		this.name = name;
	}
	
	public SafeComponent addChildren(SafeComponent safeComponent){
		this.children.add(safeComponent);
		return this;
	}
	
	public SafeComponent removeChildren(SafeComponent safeComponent){
		this.children.remove(safeComponent);
		return this;
	}
	
	@Override
	public String doSomething() {
		return "我是安全性组合模式中的组合组件：" + this.name;
	}

	@Override
	public SafeComponent getParent() {
		return this.getParent();
	}
	
	@Override
	public String toString() {
		return this.name;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Set<SafeComponent> getChildren() {
		return this.children;
	}

	public void setChildren(Set<SafeComponent> children) {
		this.children = children;
	}
}
